package com.plian.system.controller.fr.monthindicators;

import com.plian.Tools.base.BaseController;
import com.plian.Tools.pagedata.PageData;
import com.plian.system.annotation.LogOperation;
import com.plian.system.model.ListResult;
import com.plian.system.model.ObjResult;
import com.plian.system.service.fr.monthindicators.IMonthIndicatorsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 说明：企业月度指标录入
 * 创建时间:2020-06-06 15:51:35
 */
@RestController
@RequestMapping(value = "api/month_indicators")
public class MonthIndicatorsController extends BaseController {

    @Autowired
    private IMonthIndicatorsService monthindicatorsServiceI;


    /**
     * 保存
     *
     * @param
     * @throws Exception
     */
    @PostMapping(value = "/save")
    @LogOperation("企业月度指标-保存")
    public ObjResult save(@RequestBody PageData pd) throws Exception {
        return monthindicatorsServiceI.save(pd);
    }

    /**
     * 修改
     *
     * @param
     * @throws Exception
     */
    @PostMapping(value = "/edit")
    @LogOperation("企业月度指标-编辑")
    public ObjResult edit(@RequestBody PageData pd) throws Exception {
        return monthindicatorsServiceI.edit(pd);
    }

    /**
     * 根据id查询
     *
     * @param pd
     * @return
     * @throws Exception
     */
    @PostMapping(value = "/findbyid")
    public ObjResult findbyid(@RequestBody PageData pd) throws Exception {
        return monthindicatorsServiceI.findbyid(pd);
    }

    @PostMapping(value = "/findidAll")
    public ObjResult findidAll(@RequestBody PageData pd) throws Exception {
        return monthindicatorsServiceI.findidAll(pd);
    }

    /**
     * 根据集合删除数据
     *
     * @param pd
     * @return
     * @throws Exception
     */
    @PostMapping(value = "/del_ids")
    @LogOperation("企业月度指标-删除")
    public ObjResult delids(@RequestBody PageData pd) throws Exception {
        return monthindicatorsServiceI.del_ids((List<String>) pd.get("ids"));
    }

    /**
     * 查询列表
     *
     * @return
     * @throws Exception
     */
    @PostMapping(value = "/list")
    public ListResult listpage(@RequestBody PageData pd) throws Exception {
        return monthindicatorsServiceI.listPage(pd);
    }

    /**
     * 查询列表
     *
     * @return
     * @throws Exception
     */
    @PostMapping(value = "/findbyorgtime")
    public ListResult findbyorgtime(@RequestBody PageData pd) throws Exception {
        return monthindicatorsServiceI.findbyorg(pd);
    }

    /**
     * 查询列表
     *
     * @return
     * @throws Exception
     */
    @PostMapping(value = "/listReport")
    public ListResult listReport(@RequestBody PageData pd) throws Exception {
        return monthindicatorsServiceI.listReport(pd);
    }
}